# 文字识别小程序
from PIL import Image
import pytesseract
import os
import sys
sys.path.append(os.getcwd())
from config.env import Env
env = Env()

class Language:
    CHS = 'chi_sim'
    ENG = 'eng'

def img_to_str(imgPath, lang=Language.ENG):
    return pytesseract.image_to_string(Image.open(imgPath), lang)

print(img_to_str(env.getImgPath() + '3.png', lang=Language.CHS))

